import axios from 'axios';

const API_BASE_URL = ''; // 替换为你的 API 基础 URL

// 获取异常订单列表
export const getDemandAbnormalList = async (params) => {
  try {
    const response = await axios.post(`${API_BASE_URL}/demandAbnormal/getList`, params);
    return response.data;
  } catch (error) {
    console.log(error,'--err')
    throw new Error('获取异常订单列表失败');
  }
};

// 获取异常订单详情
export const getDemandAbnormalDetail = async (params) => {
  try {
    const response = await axios.get(`${API_BASE_URL}/demandAbnormal/getDemandAbnormalDetail`, { params });
    return response.data;
  } catch (error) {
    throw new Error('获取异常订单详情失败');
  }
};

// 处理异常订单
export const handleDemandAbnormal = async (params) => {
  try {
    const response = await axios.post(`${API_BASE_URL}/demandAbnormal/handleDemandAbnormal`, params);
    return response.data;
  } catch (error) {
    throw new Error('处理异常订单失败');
  }
};